package com.gitee.luosl.cola.lang;

import java.util.Map;

public interface Tuple {

    static <T1> Tuple1<T1> of(T1 _1){
        return new Tuple1<>(_1);
    }

    static <T1, T2> Tuple2<T1, T2> of(T1 _1, T2 _2){
        return new Tuple2<>(_1, _2);
    }

    static <T1, T2> Tuple2<T1, T2> of(Map.Entry<T1, T2> entry){
        return new Tuple2<>(entry.getKey(), entry.getValue());
    }

    static <T1, T2, T3> Tuple3<T1, T2, T3> of(T1 _1, T2 _2, T3 _3){
        return new Tuple3<>(_1, _2, _3);
    }

    static <T1, T2, T3, T4> Tuple4<T1, T2, T3, T4> of(T1 _1, T2 _2, T3 _3, T4 _4){
        return new Tuple4<>(_1, _2, _3, _4);
    }

    static <T1, T2, T3, T4, T5> Tuple5<T1, T2, T3, T4, T5> of(T1 _1, T2 _2, T3 _3, T4 _4, T5 _5){
        return new Tuple5<>(_1, _2, _3, _4, _5);
    }

    static <T1, T2, T3, T4, T5, T6> Tuple6<T1, T2, T3, T4, T5, T6> of(T1 _1, T2 _2, T3 _3, T4 _4, T5 _5, T6 _6){
        return new Tuple6<>(_1, _2, _3, _4, _5, _6);
    }

}
